home *** CD-ROM | disk | FTP | other *** search
- /*
- * TrimLine.c cuts program source text into reasonable line lengths.
- * This has been a problem with some sources which are generated by
- * programs--ILBM2Image for example.
- * Standard input and standard output are used.
- */
-
- #include <stdio.h>
-
- int main(int argc, char *argv[])
- {
- int a, column;
-
- column = 0;
-
- while( (a=getchar()) != EOF)
- {
- putchar(a);
- column++;
- switch (a)
- {
- case ',' :
- case ' ' : if (column > 60)
- {
- putchar('\n');
- column = 0;
- }
- break;
- case '\n': column = 0;
- default : break;
- }
- }
- return 0;
- }
-